package Chapter2.Comparing.c5;

import java.util.Calendar;
import java.util.Scanner;

public class dateTest2 {
    public static void main(String[] args) {
        System.out.println("请输入年");
        Scanner scanner= new Scanner(System.in);
        int year = scanner.nextInt();
        System.out.println("请输入月");
        int month = scanner.nextInt();
        System.out.println("请输入日");
        int day = scanner.nextInt();

        Calendar c1 = Calendar.getInstance();
        Calendar c2 = Calendar.getInstance();

        c1.set(year,month-1,1);
        c2.set(year,month,1);

        long days = (c2.getTimeInMillis()-c1.getTimeInMillis())/(1000*60*60*24);
        System.out.println("该月有"+days+"天");
    }
}
